/* ===========================================
   THEME TOGGLE STYLES
   =========================================== */

.theme-selector {
    position: relative;
}

.theme-toggle-switch {
    position: relative;
    cursor: pointer;
    pointer-events: auto;
    z-index: 10;
}

.theme-toggle-switch .toggle-track {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #f0f0f0;
    box-shadow: 
        inset 4px 4px 8px rgba(0, 0, 0, 0.1),
        inset -4px -4px 8px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    overflow: hidden;
    pointer-events: auto;
    cursor: pointer;
}

.theme-toggle-switch.expanded .toggle-track {
    width: 120px;
    justify-content: space-between;
    padding: 0 8px;
}

.theme-toggle-switch .toggle-slider {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    left: 4px;
    top: 4px;
    background: #f0f0f0;
    transition: all 0.3s ease;
    box-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.2),
        -1px -1px 2px rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    box-sizing: border-box;
}

.theme-toggle-switch:not(.expanded) .toggle-slider {
    left: 4px;
    top: 4px;
    right: auto;
    margin: 0;
}

.theme-toggle-switch:not(.expanded).active-night .toggle-slider {
    left: 4px;
    top: 4px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 
        0 2px 8px rgba(30, 64, 175, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.1),
        -1px -1px 2px rgba(255, 255, 255, 0.8);
}

.theme-toggle-switch:not(.expanded).active-day .toggle-slider {
    left: 4px;
    top: 4px;
    background: linear-gradient(135deg, #fde047, #facc15);
    box-shadow: 
        0 2px 8px rgba(251, 191, 36, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.1),
        -1px -1px 2px rgba(255, 255, 255, 0.8);
}

.theme-toggle-switch:not(.expanded).active-day .toggle-track {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 
        0 4px 15px rgba(251, 191, 36, 0.3),
        inset 2px 2px 4px rgba(0, 0, 0, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.2);
}

.theme-toggle-switch:not(.expanded).active-night .toggle-track {
    background: #1e40af;
    box-shadow: 
        0 4px 15px rgba(30, 64, 175, 0.3),
        inset 2px 2px 4px rgba(0, 0, 0, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.1);
}

.theme-toggle-switch .theme-icon {
    font-size: 16px;
    line-height: 1;
}

/* Animation for rotating sun and moon icons */
@keyframes rotate-center {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.theme-toggle-switch .theme-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    transition: filter 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7));
    animation: rotate-center 3s linear infinite;
    transform-origin: center center;
}

.theme-toggle-switch:hover .theme-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.theme-toggle-switch:hover .theme-icon-img {
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.9));
    animation: rotate-center 2s linear infinite;
}

.theme-toggle-switch .theme-text {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.theme-toggle-switch.expanded .theme-text {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Active state - Day mode selected */
.theme-toggle-switch.active-day .toggle-track {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 
        0 4px 15px rgba(251, 191, 36, 0.3),
        inset 2px 2px 4px rgba(0, 0, 0, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.2);
}

/* Day mode slider always at left (4px) */
.theme-toggle-switch.active-day .toggle-slider {
    left: 4px;
    background: linear-gradient(135deg, #fde047, #facc15);
    box-shadow: 
        0 2px 8px rgba(251, 191, 36, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.1),
        -1px -1px 2px rgba(255, 255, 255, 0.8);
}

.theme-toggle-switch.active-day .day-text {
    opacity: 0;
    visibility: hidden;
}

.theme-toggle-switch.active-day .night-text {
    color: #FFFFFF;
}

/* Active state - Night mode selected */
.theme-toggle-switch.active-night .toggle-track {
    background: #1e40af;
    box-shadow: 
        0 4px 15px rgba(30, 64, 175, 0.3),
        inset 2px 2px 4px rgba(0, 0, 0, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.1);
}

/* When expanded, slider moves to right for night mode */
.theme-toggle-switch.expanded.active-night .toggle-slider {
    left: 84px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 
        0 2px 8px rgba(30, 64, 175, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.1),
        -1px -1px 2px rgba(255, 255, 255, 0.8);
}

/* When not expanded, slider stays at left but track shows night color */
.theme-toggle-switch:not(.expanded).active-night .toggle-slider {
    left: 4px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 
        0 2px 8px rgba(30, 64, 175, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.1),
        -1px -1px 2px rgba(255, 255, 255, 0.8);
}

.theme-toggle-switch.active-night .day-text {
    color: #FFFFFF;
}

.theme-toggle-switch.active-night .night-text {
    opacity: 0;
    visibility: hidden;
}

.theme-toggle-switch:hover .toggle-track {
    box-shadow: 
        inset 2px 2px 4px rgba(0, 0, 0, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.8);
}

.theme-toggle-switch:hover .toggle-slider {
    box-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.2),
        -1px -1px 2px rgba(255, 255, 255, 0.8);
}

.theme-toggle-switch.active-day:hover .toggle-track {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 
        0 6px 20px rgba(251, 191, 36, 0.5),
        inset 2px 2px 4px rgba(0, 0, 0, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.2);
}

.theme-toggle-switch.active-day:hover .toggle-slider {
    background: linear-gradient(135deg, #facc15, #eab308);
    box-shadow: 
        0 4px 12px rgba(251, 191, 36, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.1),
        -1px -1px 2px rgba(255, 255, 255, 0.8);
}

.theme-toggle-switch.active-night:hover .toggle-track {
    background: #1d4ed8;
    box-shadow: 
        0 6px 20px rgba(30, 64, 175, 0.5),
        inset 2px 2px 4px rgba(0, 0, 0, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.1);
}

.theme-toggle-switch.active-night:hover .toggle-slider {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 
        0 4px 12px rgba(30, 64, 175, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.1),
        -1px -1px 2px rgba(255, 255, 255, 0.8);
}


